package com.javayh.service;

import com.javayh.producer.RabbitOrderSender;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author Dylan Yang
 * @Title: RibbitOrderSend
 * @ProjectName lucky
 * @Description: TODO
 * @date 2018/10/619:38
 */
@Service
public class OrderSend {

    /*@Autowired
    private OrderDao orderDao;

    @Autowired
    private MessageLogDao messageLogDao;*/

    @Autowired
    private RabbitOrderSender orderSend;

//    public void  createOrder(Order order) throws Exception{
//        Date date = new Date();
//        orderDao.insertOrder(order);
//        MessageLog messageLog = new MessageLog();
//        messageLog .setMessageId(order.getMessageId());
//        messageLog.setMessage(JSONArray.toJSONString(order));
//        messageLog.setStatus("0");
//        messageLog.setNextRetry(DateUtils.addMilliseconds(date,Constants.ORDER_TIMEOUT));
//        messageLog.setCreateTime(new Date());
//        messageLog.setUpdateTime(new Date());
//        messageLogDao.insertMessageLog(messageLog);
//        orderSend.sendOrder(order);
//    }

}

